package net.bwie.jtp.app.udf;

import ch.hsr.geohash.GeoHash;
import org.apache.hadoop.hive.ql.exec.Description;
import org.apache.hadoop.hive.ql.exec.UDF;


public class ConvertGeoHash extends UDF {
    public String evaluate(double latitude,double logitude,int precision) {
        //创建GEOHash对象，指定经纬度和精度
        GeoHash geoHash = GeoHash.withCharacterPrecision(latitude, logitude, precision);
        return geoHash.toBase32();
    }

}
